//
//  BGAddInviteOnePickViewModel.m
//  bigMall
//
//  Created by LTOVE on 16/8/23.
//  Copyright © 2016年 thinklev. All rights reserved.
//

#import "BGAddInviteOnePickViewModel.h"


#import "LTOVEPickView.h"

@interface BGAddInviteOnePickViewModel ()<datePickDelegate>

@end

@implementation BGAddInviteOnePickViewModel

-(void)dateValueChangedWithDate:(NSDate *)date
{
    if ([_delegate respondsToSelector:@selector(pickViewChangedValues:)]) {

        [_delegate pickViewChangedValues:date];
    }
}

- (void)pickViewChangedWithArray:(NSArray *)array
{
    
    if ([_delegate respondsToSelector:@selector(pickViewChangedValues:)]) {
        

        [_delegate pickViewChangedValues:array];
        
    }
}

- (void)pickViewChangedWithIndexArray:(NSArray *)array
{
    if ([_delegate respondsToSelector:@selector(pickViewChangedIndexValues:)]) {
        [_delegate pickViewChangedIndexValues:array];
    }
    
}
- (AddInviteOneOption)option
{
    void (^(MyBlock))() = ^(){
    
        LTOVEPickView *pickView = [[LTOVEPickView alloc]init];
//        pickView.delegate = self;
        if (_isDatePick) {
            //datepickView
            pickView = [LTOVEPickView dateObjWithHeigh:180 andPickModel:UIDatePickerModeDate andDateFormStr:nil];
            
            pickView.delegate = self;
            [pickView initDatePickViewValue];
        }else{
        
            //pickView
            pickView =  [LTOVEPickView showPickViewWithHeigh:180 andDateArray:_dateArray];
            
            pickView.delegate = self;
            [pickView initPickViewValue];
        }
        pickView.frame = BGKeyWindow.bounds;
        
        
        [BGKeyWindow addSubview:pickView];
        
    };
    
    return MyBlock;
}
@end
